home *** CD-ROM | disk | FTP | other *** search
- -- background: 3325 from stack: in.0
- -- bmap block id: 2699
- -- flags: 0000
- -- background id: 0
- -- name: Font List
- ----- HyperTalk script -----
- --**********************************************************
- --* Font List Script by Dr. John A. Koch 3/30/88 *
- --* Computer Science Department *
- --* Wilkes College *
- --* Wilkes-Barre, PA 18766 *
- --* CompuServe: 72457,736 *
- --* AppleLink: U0192 *
- --* *
- --* This script is messageware. Send me a message if *
- --* you find it useful or have suggestions. *
- --* *
- --* This stack is ©1988. May not be sold for profit. *
- --* *
- --* This script gets a list of system fonts and sizes. *
- --* It saves and restores the original font settings. *
- --* *
- --* It returns 1 line per font with items as follows: *
- --* *
- --* item 1 is the font name *
- --* items 2 through last are the font sizes *
- --* *
- --* For example, this function might return: *
- --* Chicago,12 -- one size (12) of the Chicago font *
- --* Geneva,9,12 -- two sizes (9 and 12) of the Geneva font *
- --* Monaco,9 -- one size (9) of the Monaco font *
- --* *
- --**********************************************************
-
- function fontList
-
- set the lockscreen to true
- hide menubar -- if you don't want user to see menu changes
- put the userlevel into savelevel
- if savelevel < 3 then
- set the userlevel to 3 -- must use paint tools
- if the userlevel < 3 then
- beep
- exit fontList
- end if
- end if
- put empty into x
- choose text tool
- put the textFont into saveFont
- put the textSize into saveSize
-
- -- first go in increasing order up from "Chicago"
- set the textFont to "Chicago" -- must be in system
- put empty into oldfont -- so it will not be equal to textfont
- repeat until the textFont = oldfont
- put empty into oldsize -- so it will not be equal to textSize
- set the textSize to 0 -- will get font size of 1, if any
- type "." with commandkey -- select the next larger size
- put the textFont into z
- repeat until the textSize = oldsize
- put ", " & the textSize after z
- put the textSize into oldsize
- type "." with commandkey -- select the next larger size
- end repeat
- put the textFont into oldfont
- type "." with shiftkey, commandkey -- select the next larger font
- put z & return after x
- end repeat
-
- -- then go in decreasing order down from "Chicago"
- set the textFont to "Chicago" -- must be in system
- type "," with shiftkey, commandkey -- select the next smaller font
- put "Chicago" into oldfont -- may be equal if none are smaller
- repeat until the textFont = oldfont
- put empty into oldsize -- so it will not be equal to textSize
- set the textSize to 0 -- will get font size of 1, if any
- type "." with commandkey -- select the next larger size
- put the textFont into z
- repeat until the textSize = oldsize
- put ", " & the textSize after z
- put the textSize into oldsize
- type "." with commandkey -- select the next larger size
- end repeat
- put the textFont into oldfont
- type "," with shiftkey, commandkey -- select the next smaller font
- put z & return before x
- end repeat
-
- set the textFont to saveFont -- restore old settings
- set the textSize to saveSize
- set the userlevel to savelevel
- show menubar -- if you have hidden it
- choose browse tool
- set the lockscreen to false
- return x
- end fontList
-